﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for Common
/// </summary>
public class Common
{
    public Common() { }

    public enum TableType : int //sub_file_type
    {
        BGCategory = 1
    }

    public static void CreateDynamicTable(ref PlaceHolder PlaceHolder1, int tblRows, int tblCols,TableType type)
    {
        PlaceHolder1.Controls.Clear();
        // Create a Table and set its properties 
        Table tbl = new Table();
        // Add the table to the placeholder control
        PlaceHolder1.Controls.Add(tbl);
        // Now iterate through the table and add your controls 
        for (int i = 0; i < tblRows; i++)
        {
            TableRow tr = new TableRow();
            for (int j = 0; j < tblCols; j++)
            {
                TableCell tc = new TableCell();
                //TextBox txtBox = new TextBox();
                //txtBox.Text = "RowNo:" + i + " " + "ColumnNo:" + " " + j;
                //// Add the control to the TableCell
                //tc.Controls.Add(txtBox);
                Literal l = new Literal();
                l.Text = "hello" + "RowNo:" + i + " " + "ColumnNo:" + " " + j;;
                tc.Controls.Add(l);
                // Add the TableCell to the TableRow
                tr.Cells.Add(tc);
            }
            // Add the TableRow to the Table
            tbl.Rows.Add(tr);
        }

        // This parameter helps determine in the LoadViewState event,
        // whether to recreate the dynamic controls or not
        //ViewState["dynamictable"] = true;
    }

    public static readonly String FlashObj = 
                @"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'
                    width='351' height='302' id='backgroundflash' align='middle'> 
                    <param name='allowScriptAccess' value='sameDomain' />
                    <param name='allowFullScreen' value='false' />
                    <param name='movie' value='Untitled-11.swf' />
                    <param name='quality' value='high' />
                    <param name='bgcolor' value='#000000' />
                    <param name='FlashVars' value='myText=%%Label%%&myLink=%%Link%%' />
                    <embed src='Untitled-11.swf' flashvars='myText=%%Label%%&myLink=%%Link%%'
                        quality='high' bgcolor='#ffffff' width='351' height='302' name='backgroundflash'
                        align='middle' allowscriptaccess='sameDomain' allowfullscreen='false' type='application/x-shockwave-flash'
                        pluginspage='http://www.macromedia.com/go/getflashplayer' />
                </object>";


}
